if (!jsx3.lang.Class.forName("tibco.admin.enterpriseAssets.envDef.envDtls.genInfo.GenInfoAdd")) {
    jsx3.require("com.gix.gui.Block")

    /**
     * EnterpriseAssets
     */
    jsx3.lang.Class.defineClass("tibco.admin.enterpriseAssets.envDef.envDtls.genInfo.GenInfoAdd",
            com.gix.gui.Block,
            null,
            function (genInfo) {

                /**
                 * instance initializer
                 * @param strName {String} unique name distinguishing this object from all other JSX GUI objects in the JSX application
                 * @param vntLeft {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param vntTop {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param vntWidth {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param vntHeight {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
                 * @param strHTML {String} Text/HTML markup to place in the jsx3.gui.Block instance
                 */
                genInfo.prototype.init = function(strName, vntLeft, vntTop, vntWidth, vntHeight, strHTML) {
                    //call constructor for super class (the super expects the name of the object and the function that it is an instance of)
                    this.jsxsuper(strName, vntLeft, vntTop, vntWidth, vntHeight, strHTML);
                };

                //validation method: should try for a pattern level thing here
                genInfo.prototype.tryToAddEnvironment = function() {
                    var textBox = this.getDescendantOfName("textboxNameAdd_27B");
                    var alreadyExistingEnvs = tibco.admin.Main.getServer().getCache().getDocument("listEnvironments27A");
                    if (alreadyExistingEnvs.selectSingleNode("//record[@name='"+textBox.getValue().trim()+"']")) {
                        //this.getDescendantOfName("blkMessage27B").setDisplay(jsx3.gui.Block.DISPLAYBLOCK, true);
                        textBox.setBackgroundColor("yellow", true);
                        textBox.setTip(tibco.admin.Main.getServer().getDynamicProperty("@txtNewEnvExists_27B", textBox.getValue().trim()));
                        tibco.admin.Main.alert(
                                tibco.admin.Main.getServer().getDynamicProperty("@CreateNewEnvErrorTitle_27B"),
                                tibco.admin.Main.getServer().getDynamicProperty("@txtNewEnvExists_27B", textBox.getValue().trim()));

                    }
                    else {
                        if (tibco.admin.util.Validation.doValidateNotEmptyNoWhSpace(textBox))
                        {
                            var btnSave = this.getDescendantOfName("btnSave_27B");
                            btnSave.setEnabled(jsx3.gui.Form.STATEDISABLED, true);
                            this.calladdEnvironment();
                        }
                    }

                }

                genInfo.prototype.calladdEnvironment = function() {
                    var objService = tibco.admin.Main.loadService("tibco.admin",
                            "tibco/admin/enterpriseAssets/envDef/envDtls/genInfo/rules/addEnvironment.xml",
                            "addEnvironment",
                            tibco.admin.Main.getServer().getDynamicProperty("@contextAddEvn_27B"));

                    //subscribe and call
                    var me = this;
                    objService.subscribe(jsx3.net.Service.ON_SUCCESS, me, me.onaddEnvironmentSuccess);
                    objService.subscribe(jsx3.net.Service.ON_ERROR, me, me.onaddEnvironmentsError);
                    objService.subscribe(jsx3.net.Service.ON_INVALID, me, me.onaddEnvironmentInvalid);
                    objService.setEndpointURL(tibco.admin.util.ServiceHelper.getEnvironmentEndpointURL());
                    objService.doCall();

                };

                genInfo.prototype.onaddEnvironmentSuccess = function(objEvent) {
                    var msg = new Object();
                    msg.subject = tibco.admin.enterpriseAssets.envDef.EventID.ENVIRONMENT_ADD_SUCCESSEFUL;
                    msg.entityId = objEvent.target.entityId
                    tibco.admin.PubSub.publish(msg);
                    this.getAncestorOfType(jsx3.gui.Dialog).doClose();
                };

                genInfo.prototype.onaddEnvironmentsError = function(objEvent) {
                    var btnSave = this.getDescendantOfName("btnSave_27B");
                    btnSave.setEnabled(jsx3.gui.Form.STATEENABLED, true);
                };

                genInfo.prototype.onaddEnvironmentInvalid = function(objEvent) {
                    var btnSave = this.getDescendantOfName("btnSave_27B");
                    btnSave.setEnabled(jsx3.gui.Form.STATEENABLED, true);
                };

                genInfo.prototype.addEnvironmentCanceled = function() {
                    var msg = new Object();
                    msg.subject = tibco.admin.enterpriseAssets.envDef.EventID.ENVIRONMENT_ADD_CANCELED;
                    tibco.admin.PubSub.publish(msg);
                    this.getAncestorOfType(jsx3.gui.Dialog).doClose();
                }


            });


}
